function net_content = setName(net_content, net_name)

net_name = sprintf('name: "%s"', net_name);

[i, j] = regexp(net_content, 'name\s*:\s*".*"\s*layer');
if isempty(i)
    net_content = [sprintf('%s\n', net_name) net_content];
else
    net_content = [regexprep(net_content(i:j), 'name\s*:\s*".*"', net_name) net_content(j+1 : end)];
end
